<html>
<title>jquery constrain input plugin demo</title>
<script src="http://visualjquery.com/jquery-1.2.6.js"></script>
<script src="jquery.constrain.input-0.1.js"></script>
<script type="text/javascript">

var test = function(){
	$("#numbers").constrainInput({allowedCharsRegex: "\\d+|\\.|,"});
	$("#lower").constrainInput({allowedCharsRegex: "[a-z]"});
	$("#x").constrainInput({allowedCharsRegex: "x"});
}

$(test);

</script>
<body>
<h1>jquery constrain input plugin demo</h1><br/>

only digits, commas and periods:<br/>
<pre>$("#numbers").constrainInput({allowedCharsRegex: "\\d+|\\.|,"});</pre>
<input id="numbers" value="" type="text">  <br/><br/>
only lower case letters:<br/>
<pre>$("#lower").constrainInput({allowedCharsRegex: "[a-z]"});</pre>
<input id="lower" value="" type="text">  <br/><br/>
only the letter x<br/>
<pre>$("#lower").constrainInput({allowedCharsRegex: "x"});</pre>
<input id="x" value="" type="text">  <br/><br/>
<br/>
more info <a href="http://notetodogself.blogspot.com/2008/10/jquery-constrain-input-chars-plugin.html">on my blog</a><br/>

get the plugin <a href="jquery.constrain.input-0.1.js">here</a>
</body>
<html>